import request from '@/utils/request'

//合同列表
export function contractList(query) {
  return request({
    url: '/contractInstance/page',
    method: 'post',
    data: query
  })
}

//合同详情
export function contractDetail(id) {
  return request({
    url: '/contractInstance/'+id,
    method: 'get'
  })
}


//生成合同
export function addContract(data) {
  return request({
    url: '/contractInstance/generate',
    method: 'post',
    data:data
  })
}

//更新合同
export function updateContract(data) {
  return request({
    url: '/contractInstance/regenerate',
    method: 'post',
    data:data
  })
}

//更新状态
export function updateContractStatus(data) {
  return request({
    url: '/contractInstance/status',
    method: 'put',
    data:data
  })
}



//认证
export function certification(id) {
  return request({
    url: '/contractInstance/certification/'+id,
    method: 'post'
  })
}

//订单详情合同信息
export function orderContract(orderNo) {
  return request({
    url: '/contractInstance/orderNo/'+orderNo,
    method: 'get'
  })
}

//订单上传合同
export function uploadContract(data) {
  return request({
    url: '/contractInstance/upload',
    method: 'post',
    data:data
  })
}
